home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / ifl / iflFile.z / iflFile
Encoding:
Text File  |  1998-10-20  |  62.4 KB  |  1,321 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllFFFFiiiilllleeee - abstraction for image file access
  10.  
  11.  
  12. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  13.      This is a base class
  14.  
  15.  
  16. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  17.      #include <il/iflFile.h>
  18.  
  19.  
  20. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      iflFile is an abstraction of a handle to an image file.  It is an
  22.      abstract base class; every iflFile object is actually an object of a
  23.      file-format-specific subclass such as iflTIFFFile.
  24.  
  25.  
  26.    CCCCrrrreeeeaaaattttiiiinnnngggg aaaannnndddd ddddeeeessssttttrrrrooooyyyyiiiinnnngggg
  27.      An IFL application opens a file by calling iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() (to open an
  28.      existing image file) or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee() (to create a new image file).
  29.      The returned value is an _i_f_l_F_i_l_e* pointing to a newly created object of
  30.      the appropriate subclass (one of iflTIFFFile, etc.).  The file can be
  31.      manipulated by calling the object's member functions.  The object can be
  32.      destroyed by calling the cccclllloooosssseeee() member function.  Buffered data is
  33.      automatically flushed during the close(), but the application may elect
  34.      to explicitly flush at any time by calling fffflllluuuusssshhhh().
  35.  
  36.      This is the only public interface to construction and destruction of
  37.      iflFile objects.  There is no public constructor or destructor for this
  38.      class or any of its subclasses.  It is illegal to create an iflFile on
  39.      the stack.
  40.  
  41.  
  42.    AAAAcccccccceeeessssssssiiiinnnngggg iiiimmmmaaaaggggeeee ddddaaaattttaaaa
  43.      Several member functions are used by an IFL application to read image
  44.      data from an image file into memory, or to write image data from memory
  45.      to an image file.
  46.  
  47.      The most general and usual interface is to use ggggeeeettttTTTTiiiilllleeee() and sssseeeettttTTTTiiiilllleeee(),
  48.      which allow reading and writing of arbitrary rectangular regions (_t_i_l_e_s),
  49.      with an arbitrary data type, dimension ordering, and orientation.
  50.  
  51.      Optimized applications may want to use the lower-level ggggeeeettttPPPPaaaaggggeeee() and
  52.      sssseeeettttPPPPaaaaggggeeee() interface, which does no conversion and requires the specified
  53.      region to be one of the file's natural _p_a_g_e_s.
  54.  
  55.      The IFL library implements ggggeeeettttTTTTiiiilllleeee() and sssseeeettttTTTTiiiilllleeee() in terms of ggggeeeettttPPPPaaaaggggeeee()
  56.      and sssseeeettttPPPPaaaaggggeeee(), which are defined by the format-specific subclasses of
  57.      iflFile.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  71.  
  72.  
  73.  
  74.    AAAAcccccccceeeessssssssiiiinnnngggg ssssuuuubbbb----iiiimmmmaaaaggggeeeessss
  75.      An image file can contain more than one image, depending on the file
  76.      format.  For example, the TIFF and GIF formats allow a file to contain
  77.      any number of unrelated images, and the Kodak Photo CD Image Pac (PCD)
  78.      and JFIF formats allow access to multiple resolutions of the same image.
  79.      Both of these situations are handled by the notion of an iflFile object's
  80.      "current image index".  Image operations and queries applied to an
  81.      iflFile object refer to the image at the current index.
  82.  
  83.      The application can change the index by calling the object's
  84.      sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() method.  The current index and total number of images in
  85.      the file can be queried by calling the ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() or ggggeeeettttNNNNuuuummmmIIIImmmmggggssss()
  86.      method, respectively.  The initial index may also be set by specifying an
  87.      index with the filename argument to iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() (see the description
  88.      of that function above).
  89.  
  90.      Note that these operations are meaningful even if the file format does
  91.      not support multiple images per file.  In that case, ggggeeeettttNNNNuuuummmmIIIImmmmggggssss() returns
  92.      1, ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg() returns 0, and sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(idx) will succeed if and
  93.      only if idx == 0.
  94.  
  95.      If an image file is open for write access and the file format and
  96.      format-specific implementation supports it, the application can append an
  97.      image to an image file by calling the aaaappppppppeeeennnnddddIIIImmmmgggg() member function.
  98.  
  99.  
  100.    IIIICCCCCCCC pppprrrrooooffffiiiilllleeeessss
  101.      An ICC (International Color Consortium) profile can be used for color
  102.      management; see _h_t_t_p://_w_w_w._c_o_l_o_r._o_r_g for more details on the specifics of
  103.      how such profiles are used.  To access the profile for those formats that
  104.      support it, call ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().  When you are done with the profile
  105.      call ffffrrrreeeeeeeeIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee() to release any allocated memory.  You can update
  106.      the profile of an image by calling sssseeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().
  107.  
  108.      The GIF, TIFF, JFIF and SGI formats included with IFL all support ICC
  109.      profiles.  New formats must implement the virtual methods listed above in
  110.      order to provide ICC profile support.
  111.  
  112.  
  113.    FFFFoooorrrrmmmmaaaatttt----ssssppppeeeecccciiiiffffiiiicccc ooooppppeeeerrrraaaattttiiiioooonnnnssss
  114.      The member functions ggggeeeettttIIIItttteeeemmmm() and sssseeeettttIIIItttteeeemmmm() deal with "items"; that is,
  115.      format-dependent name-value pairs associated with an image within an
  116.      image file.
  117.  
  118.      Usage of these functions requires format-specific knowledge of the
  119.      meaning of the tags for the specific file format; e.g. for iflTIFFFile,
  120.      the meaning of the tags is given in the TIFF spec.
  121.  
  122.  
  123.    DDDDeeeeaaaalllliiiinnnngggg wwwwiiiitttthhhh ccccoooonnnnccccuuuurrrrrrrreeeennnntttt aaaacccccccceeeesssssssseeeessss
  124.      If an IFL application is going to make concurrent calls to an iflFile's
  125.      ggggeeeettttPPPPaaaaggggeeee() and/or sssseeeettttPPPPaaaaggggeeee() methods, it must provide the iflFile object
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  137.  
  138.  
  139.  
  140.      with a semaphore mechanism.  The application does this by supplying a
  141.      beginFileIO callback with sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() (which should acquire a
  142.      semaphore) and an endFileIO callback with sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() (which should
  143.      release the semaphore).  These callbacks will be called by ggggeeeettttPPPPaaaaggggeeee() and
  144.      sssseeeettttPPPPaaaaggggeeee() surrounding thread-unsafe code.
  145.  
  146.      See the next section for the DSO implementor's interface to this
  147.      mechanism.
  148.  
  149.  
  150. DDDDEEEERRRRIIIIVVVVIIIINNNNGGGG SSSSUUUUBBBBCCCCLLLLAAAASSSSSSSSEEEESSSS
  151.      iflFile subclass implementors must surround code that needs to be
  152.      executed atomically with calls to the protected bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO() and
  153.      eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() member functions (which call the application's beginFileIO
  154.      and endFileIO callbacks, respectively, if they exist).
  155.  
  156.      The most common and unavoidable case is when getPage or setPage contain
  157.      an llllsssseeeeeeeekkkk() and a subsequent rrrreeeeaaaadddd() or wwwwrrrriiiitttteeee(); this code must be
  158.      surrounded by bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO()/eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() to insure that concurrent calls
  159.      don't change the I/O pointer between the seek and the read or write.
  160.  
  161.      If the underlying sssseeeettttPPPPaaaaggggeeee()/ggggeeeettttPPPPaaaaggggeeee() code is completely non-MP-safe, the
  162.      implementor may choose to surround the entire function bodies with
  163.      bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO()/eeeennnnddddFFFFiiiilllleeeeIIIIOOOO().
  164.  
  165.  
  166.    CCCCrrrreeeeaaaattttiiiinnnngggg aaaannnndddd ddddeeeessssttttrrrrooooyyyyiiiinnnngggg
  167.      The IFL library's functions ooooppppeeeennnn()/ccccrrrreeeeaaaatttteeee()/cccclllloooosssseeee() methods call the
  168.      ooooppppeeeennnnFFFFiiiilllleeee()/ccccrrrreeeeaaaatttteeeeFFFFiiiilllleeee()/cccclllloooosssseeeeFFFFiiiilllleeee() protected virtual functions to
  169.      perform the subclass-specific initialization and destruction of an
  170.      iflFile object.  These functions are not accessible to the application.
  171.  
  172.      If you install ifl_dev.sw.gifts then you can check out the source code
  173.      provided in /usr/share/src/ifl for more examples of deriving from
  174.      iflFile.
  175.  
  176.  
  177. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  178.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  179.  
  180.           iflFile() _p_r_o_t_e_c_t_e_d
  181.  
  182.      OOOOppppeeeennnn////ccccrrrreeeeaaaatttteeee////cccclllloooosssseeee mmmmeeeetttthhhhooooddddssss
  183.  
  184.           static iflFile* open(iflFileDesc& fileDesc, int mode = O_RDONLY,
  185.                                iflStatus* status=NULL)
  186.           static iflFile* open(int fd, const char* filename, int mode=O_RDONLY,
  187.                                iflFormat* format=NULL, iflStatus* status=NULL)
  188.           static iflFile* open(const char* filename, int mode = O_RDONLY,
  189.                                iflStatus* status=NULL)
  190.           static iflFile* create(iflFileDesc& fileDesc, iflFile* source,
  191.                                  const iflFileConfig* cfg=NULL,
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  203.  
  204.  
  205.  
  206.                                  iflStatus* status=NULL)
  207.           static iflFile* create(int fd, const char *filename, iflFile* source,
  208.                                  const iflFileConfig* cfg=NULL,
  209.                                  iflFormat* format=NULL, iflStatus* status=NULL)
  210.           static iflFile* create(const char *filename, iflFile* source,
  211.                                  const iflFileConfig* cfg=NULL,
  212.                                  iflFormat* format=NULL, iflStatus* status=NULL)
  213.           iflStatus close(int flags = 0)
  214.           virtual iflStatus flush()
  215.           static char* parseFileName(const char* fullname, char** formatName=NULL,
  216.                                      int* index=NULL, char** formatArgs=NULL)
  217.  
  218.  
  219.    PPPPuuuubbbblllliiiicccc ffffuuuunnnnccccttttiiiioooonnnnssss ttttoooo ggggeeeetttt////sssseeeetttt iiiimmmmaaaaggggeeee ddddaaaattttaaaa
  220.           iflStatus getTile(int x, int y, int z, int nx, int ny,
  221.                             int nz, void *data, const iflConfig* config=NULL)
  222.           iflStatus setTile(int x, int y, int z, int nx, int ny,
  223.                             int nz, const void *data, const iflConfig* config=NULL)
  224.           virtual iflStatus getPage(void* data, int x, int y, int z,
  225.                                     int c, int nx, int ny, int nz,
  226.                                     int nc)
  227.           virtual iflStatus setPage(const void* data, int x, int y,
  228.                                     int z, int c, int nx, int ny,
  229.                                     int nz, int nc)
  230.           virtual iflStatus getCompressedPage(...)
  231.           virtual iflStatus decompressPage(...)
  232.           virtual iflStatus compressPage(...)
  233.           virtual iflStatus setCompressedPage(...)
  234.  
  235.  
  236.    MMMMaaaannnniiiippppuuuullllaaaattttiiiinnnngggg tttthhhheeee ccccuuuurrrrrrrreeeennnntttt iiiimmmmaaaaggggeeee iiiinnnnddddeeeexxxx
  237.           virtual int getNumImgs()
  238.           virtual int getCurrentImg()
  239.           virtual iflStatus setCurrentImg(int i)
  240.  
  241.  
  242.    AAAAddddddddiiiinnnngggg iiiimmmmaaaaggggeeeessss
  243.           virtual iflStatus appendImg(iflFile* source, iflFileConfig* fc=NULL)
  244.  
  245.  
  246.    AAAAttttttttrrrriiiibbbbuuuutttteeee qqqquuuueeeerrrryyyy
  247.           const char* getFileName()
  248.           int getFileDesc()
  249.           int getFileMode()
  250.           iflFormat* getFormat()
  251.           iflColorModel getColorModel()
  252.           int* getChannelPermutation()
  253.           void getDimensions(iflSize& dimensions)
  254.           void getSize(iflSize& sz, iflOrientation toOrientation)
  255.           int getZsize()
  256.           int getCsize()
  257.           iflDataType getDataType()
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  269.  
  270.  
  271.  
  272.           iflOrder getOrder()
  273.           void getPageDimensions(iflSize& pageDims)
  274.           void getPageSize(iflSize& sz, iflOrientation toOrientation)
  275.           iflOrientation getOrientation()
  276.           iflCompression getCompression()
  277.           virtual iflStatus getColormap(const iflColormap*& cmap)
  278.           virtual iflStatus getStatMinMax(double& min, double& max)
  279.           virtual iflStatus getScaleMinMax(double& min, double& max)
  280.           iflStatus getItem(int tag, ...)
  281.           virtual iflStatus getItem(int tag, va_list ap)
  282.           int haveAttributesChanged()
  283.  
  284.  
  285.    AAAAttttttttrrrriiiibbbbuuuutttteeee sssseeeettttttttiiiinnnngggg
  286.           virtual iflStatus setColormap(const iflColormap* cmap)
  287.           virtual iflStatus setStatMinMax(double min, double max)
  288.           virtual iflStatus setScaleMinMax(double min, double max)
  289.           iflStatus setItem(int tag, ...)
  290.           virtual iflStatus setItem(int tag, va_list ap)
  291.           void setBeginFileIO_CB(iflStatus(*cb)(void*), void* arg)
  292.           void setEndFileIO_CB(iflStatus(*cb)(void*), void* arg)
  293.           void markAttributesChanged()  _p_r_o_t_e_c_t_e_d
  294.  
  295.  
  296.    FFFFiiiilllleeee aaaarrrrgggguuuummmmeeeennnntttt ppppaaaarrrrssssiiiinnnngggg
  297.           int parseArguments(iflParameterDesc* params, int maxParams) _p_r_o_t_e_c_t_e_d
  298.           static int lookupName(const char* name, const iflNameDesc* names)_p_r_o_t_e_c_t_e_d
  299.  
  300.  
  301.    MMMMuuuullllttttiiii----pppprrrroooocccceeeessssssssiiiinnnngggg pppprrrrooootttteeeeccccttttiiiioooonnnn
  302.           iflStatus beginFileIO()  _p_r_o_t_e_c_t_e_d
  303.           iflStatus endFileIO()    _p_r_o_t_e_c_t_e_d
  304.  
  305.  
  306.    IIIICCCCCCCC pppprrrrooooffffiiiilllleeee aaaacccccccceeeessssssss
  307.           virtual iflStatus getICCProfile(int& size, void*& profile)
  308.           virtual iflStatus freeICCProfile(void* profile)
  309.           virtual iflStatus setICCProfile(int size, const void* profile)
  310.  
  311.  
  312.  
  313. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  314.      iiiiffffllllFFFFiiiilllleeee(((())))
  315.  
  316.           iflFile() _p_r_o_t_e_c_t_e_d
  317.  
  318.  
  319.           The protected default constructor, called implicitly in derived-
  320.           class constructors, initializes itself to an empty state.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  335.  
  336.  
  337.  
  338.      aaaappppppppeeeennnnddddIIIImmmmgggg(((())))
  339.  
  340.           virtual iflStatus appendImg(iflFile* source, iflFileConfig* fc=NULL)
  341.  
  342.  
  343.           This virtual member function appends an image to the image file, and
  344.           sets the current image index to the index of the new (last) image.
  345.  
  346.           The _s_o_u_r_c_e and _c_f_g parameters are treated the same as in the
  347.           _c_r_e_a_t_e() static member function.
  348.  
  349.           On success, the function returns iflOKAY.  If the operation fails
  350.           for some reason, an IFL error will be thrown via the iiiiffffllllEEEErrrrrrrroooorrrr()
  351.           mechanism, and the file's contents and the object's current index
  352.           will be in an unknown state.
  353.  
  354.      bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO(((())))
  355.  
  356.           iflStatus beginFileIO()  _p_r_o_t_e_c_t_e_d
  357.  
  358.  
  359.           Calls the beginFileIO callback that was set by the application by a
  360.           previous call to sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(), and returns the returned
  361.           value.  If no callback was set, just returns iflOKAY.
  362.  
  363.      cccclllloooosssseeee(((())))
  364.  
  365.           iflStatus close(int flags = 0)
  366.  
  367.  
  368.           This member function flushes any buffered data to the file referred
  369.           to by the object (unless _I_F_L__C_L_O_S_E__D_I_S_C_A_R_D is specified in the flags
  370.           argument), closes the file, and destroys the object.  This is the
  371.           only way for the application to destroy an iflFile object (there is
  372.           no public destructor).
  373.  
  374.           Note that the file descriptor will be closed even if it was opened
  375.           prior to the original iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee().  If the
  376.           caller wants to keep the file descriptor open, it must dddduuuupppp() the
  377.           file descriptor beforehand and use the resulting file descriptor as
  378.           the argument to the original iiiiffffllllFFFFiiiilllleeee::::::::ooooppppeeeennnn() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee().
  379.  
  380.           Then _f_l_a_g_s parameter is the bitwise "or" of zero or more of the
  381.           following:
  382.  
  383.           _I_F_L__C_L_O_S_E__D_I_S_C_A_R_D   The default behavior is to call the fffflllluuuusssshhhh()
  384.                               member function before closing the file.  This
  385.                               flag suppresses that call.
  386.  
  387.           All three operations (flushing, closing, destroying the object) are
  388.           performed regardless of whether any of them returns failure.  If an
  389.           error is returned from any of them, the first such error value will
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  401.  
  402.  
  403.  
  404.           be returned up the caller; otherwise iflOKAY will be returned.
  405.  
  406.      ccccoooommmmpppprrrreeeessssssssPPPPaaaaggggeeee(((())))
  407.  
  408.           virtual iflStatus compressPage(...)
  409.  
  410.  
  411.           This method is part of IFL's intended future support for for per-
  412.           page compression and decompression of image data.  It is currently
  413.           unsupported.
  414.  
  415.      ccccrrrreeeeaaaatttteeee(((())))
  416.  
  417.           static iflFile* create(const char *filename, iflFile* source,
  418.                                  const iflFileConfig* cfg=NULL,
  419.                                  iflFormat* format=NULL, iflStatus* status=NULL)
  420.           static iflFile* create(int fd, const char *filename, iflFile* source,
  421.                                  const iflFileConfig* cfg=NULL,
  422.                                  iflFormat* format=NULL, iflStatus* status=NULL)
  423.           static iflFile* create(iflFileDesc& fileDesc, iflFile* source,
  424.                                  const iflFileConfig* cfg=NULL,
  425.                                  iflStatus* status=NULL)
  426.  
  427.  
  428.           This static class member function creates a new image file with the
  429.           specified name and attributes.
  430.  
  431.           The _f_i_l_e_n_a_m_e argument specifies the file name of the file to be
  432.           created.  An existing file descriptor may be given additionally or
  433.           instead using the _f_d parameter, exactly as for ooooppppeeeennnn().
  434.  
  435.           The _f_o_r_m_a_t argument specifies the desired output format.  If this
  436.           argument is NULL, a format is selected by the file typing rules
  437.           using the filename's extension.  If no match is found, the format
  438.           iiiiffffllllFFFFoooorrrrmmmmaaaatttt::::::::ffffiiiinnnnddddBBBByyyyFFFFoooorrrrmmmmaaaattttNNNNaaaammmmeeee("TIFF") is used by default.
  439.  
  440.           The alternate form taking a _f_i_l_e_D_e_s_c argument, encapsulates the _f_d,
  441.           _f_i_l_e_n_a_m_e and _f_o_r_m_a_t arguments in this single argument.  See
  442.           iflFileDesc(3) for more details.
  443.  
  444.           The new image file's dimensions, data type, dimension order, color
  445.           model, orientation, compression, and page dimensions may be
  446.           specified using the _c_f_g parameter; if not, they are copied from the
  447.           _s_o_u_r_c_e iflFile* if one was given (as described below) or defaulted
  448.           to the format's "preferred" value for the respective parameter.
  449.  
  450.           When an existing _s_o_u_r_c_e iflFile* is specified; any parameters not
  451.           specified in the _c_f_g parameter will be copied from this source
  452.           iflFile (if the value is supported by the destination format) or
  453.           heuristically selected to be a supported value most suitable for
  454.           copying data from the source iflFile*.
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  467.  
  468.  
  469.  
  470.           On successful completion, the function returns a pointer to a
  471.           newly-created object of the appropriate subclass of iflFile, which
  472.           the application should eventually destroy using its cccclllloooosssseeee() method.
  473.  
  474.           On failure, the function returns NULL and, if the _s_t_a_t_u_s argument is
  475.           non-NULL, sets the pointed-to iflStatus value to the appropriate
  476.           error value.
  477.  
  478.      ddddeeeeccccoooommmmpppprrrreeeessssssssPPPPaaaaggggeeee(((())))
  479.  
  480.           virtual iflStatus decompressPage(...)
  481.  
  482.  
  483.           This method is part of IFL's intended future support for for per-
  484.           page compression and decompression of image data.  It is currently
  485.           unsupported.
  486.  
  487.      eeeennnnddddFFFFiiiilllleeeeIIIIOOOO(((())))
  488.  
  489.           iflStatus endFileIO()    _p_r_o_t_e_c_t_e_d
  490.  
  491.  
  492.           Calls the endFileIO callback that was set by the application by a
  493.           previous call to sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(), and returns the returned value.
  494.           If no callback was set, just returns iflOKAY.
  495.  
  496.      fffflllluuuusssshhhh(((())))
  497.  
  498.           virtual iflStatus flush()
  499.  
  500.  
  501.           This virtual member function is used to write out any data that is
  502.           buffered in the iflFile object.  It is called automatically by the
  503.           cccclllloooosssseeee() member function (but this can be overridden, see description
  504.           of cccclllloooosssseeee() above).
  505.  
  506.           It should return iflOKAY on success, or an appropriate iflStatus
  507.           error value on failure.
  508.  
  509.      ffffrrrreeeeeeeeIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee(((())))
  510.  
  511.           virtual iflStatus freeICCProfile(void* profile)
  512.  
  513.  
  514.           The virtual member function frees the profile returned by
  515.           ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee().
  516.  
  517.      ggggeeeettttCCCChhhhaaaannnnnnnneeeellllPPPPeeeerrrrmmmmuuuuttttaaaattttiiiioooonnnn(((())))
  518.  
  519.           int* getChannelPermutation()
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  533.  
  534.  
  535.  
  536.           This member function returns an array representing the channel
  537.           permutation of the current image in the image file, or NULL (meaning
  538.           the identity permutation).  It is an array, indexed by memory
  539.           channel, into the channels stored in the file (as accessed by
  540.           ggggeeeettttPPPPaaaaggggeeee()/sssseeeettttPPPPaaaaggggeeee()).  This should be used by callers of
  541.           ggggeeeettttPPPPaaaaggggeeee()/sssseeeettttPPPPaaaaggggeeee() to re-order the data.
  542.  
  543.      ggggeeeettttCCCCoooolllloooorrrrMMMMooooddddeeeellll(((())))
  544.  
  545.           iflColorModel getColorModel()
  546.  
  547.  
  548.           This member function returns the color model of the current image in
  549.           the image file.
  550.  
  551.      ggggeeeettttCCCCoooolllloooorrrrmmmmaaaapppp(((())))
  552.  
  553.           virtual iflStatus getColormap(const iflColormap*& cmap)
  554.  
  555.  
  556.           Returns the color map associated with the current image in the image
  557.           file.
  558.  
  559.           On successful completion, iflOKAY will be returned and _c_m_a_p will be
  560.           set to point to a colormap stored in the iflFile object.  Note that
  561.           this colormap cannot be assumed to remain valid across calls to
  562.           sssseeeettttCCCCoooolllloooorrrrmmmmaaaapppp(), sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(), aaaappppppppeeeennnnddddIIIImmmmgggg(), cccclllloooosssseeee(), or calls to
  563.           sssseeeettttIIIItttteeeemmmm() that report modification of the image's attributes.
  564.  
  565.           On failure, the return value is an iflStatus encoding the reason for
  566.           the failure, and the argument _c_m_a_p is undefined.
  567.  
  568.      ggggeeeettttCCCCoooommmmpppprrrreeeesssssssseeeeddddPPPPaaaaggggeeee(((())))
  569.  
  570.           virtual iflStatus getCompressedPage(...)
  571.  
  572.  
  573.           This method is part of IFL's intended future support for for per-
  574.           page compression and decompression of image data.  It is currently
  575.           unsupported.
  576.  
  577.      ggggeeeettttCCCCoooommmmpppprrrreeeessssssssiiiioooonnnn(((())))
  578.  
  579.           iflCompression getCompression()
  580.  
  581.  
  582.           Returns the compression method used for the current image in the
  583.           image file.
  584.  
  585.      ggggeeeettttCCCCssssiiiizzzzeeee(((())))
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  599.  
  600.  
  601.  
  602.           int getCsize()
  603.  
  604.  
  605.           Returns the number of channels in the current image in the image
  606.           file.
  607.  
  608.      ggggeeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(((())))
  609.  
  610.           virtual int getCurrentImg()
  611.  
  612.  
  613.           This virtual member function returns the iflFile's current image
  614.           index, i.e. the index into the list of images or resolutions in the
  615.           image file, starting at 0.
  616.  
  617.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  618.  
  619.           iflDataType getDataType()
  620.  
  621.  
  622.           This member function returns the data type of the current image in
  623.           the image file.
  624.  
  625.      ggggeeeettttDDDDiiiimmmmeeeennnnssssiiiioooonnnnssss(((())))
  626.  
  627.           void getDimensions(iflSize& dimensions)
  628.  
  629.  
  630.           Returns the dimensions (width,height,z,c) of the current image in
  631.           the image file, expressed with in conventional (x == width, y ==
  632.           height) orientation.
  633.  
  634.      ggggeeeettttFFFFiiiilllleeeeDDDDeeeesssscccc(((())))
  635.  
  636.           int getFileDesc()
  637.  
  638.  
  639.           This member function returns the file descriptor used to access the
  640.           image file.
  641.  
  642.      ggggeeeettttFFFFiiiilllleeeeMMMMooooddddeeee(((())))
  643.  
  644.           int getFileMode()
  645.  
  646.  
  647.           This member function returns the access mode by which the file can
  648.           be accessed.  It is _O__R_D_O_N_L_Y, _O__W_R_O_N_L_Y, or _O__R_D_W_R.
  649.  
  650.      ggggeeeettttFFFFiiiilllleeeeNNNNaaaammmmeeee(((())))
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  665.  
  666.  
  667.  
  668.           const char* getFileName()
  669.  
  670.  
  671.           This member function returns the file name of the image file, or
  672.           NULL if the name is unknown (e.g. if the file was opened with a file
  673.           descriptor only).  The returned string points to data within the
  674.           object, and will become invalid when the object is destroyed.
  675.  
  676.      ggggeeeettttFFFFoooorrrrmmmmaaaatttt(((())))
  677.  
  678.           iflFormat* getFormat()
  679.  
  680.  
  681.           Returns a pointer to the file format associated with the file.  The
  682.           pointed-to object is static and valid forever.
  683.  
  684.      ggggeeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee(((())))
  685.  
  686.           virtual iflStatus getICCProfile(int& size, void*& profile)
  687.  
  688.  
  689.           This virtual member function returns the value of the ICC profile
  690.           associated with the image.  The return value is iflOKAY on success,
  691.           or an appropriate iflStatus error value on failure.
  692.  
  693.      ggggeeeettttIIIItttteeeemmmm(((())))
  694.  
  695.           iflStatus getItem(int tag, ...)
  696.           virtual iflStatus getItem(int tag, va_list ap)
  697.  
  698.  
  699.           Gets the value of an item associated with the current image in the
  700.           image file.
  701.  
  702.           The _t_a_g argument specifies the name of the item to be set; it is
  703.           interpreted by the specific iflFile subclass.  The number and types
  704.           of the remaining arguments are determined the particular subclass of
  705.           iflFile and the tag value.
  706.  
  707.           The return value is iflOKAY on success, or an appropriate iflStatus
  708.           error value on failure.
  709.  
  710.           The second overloaded form of this method is used by libraries that
  711.           are passing along a variable calling sequence in _a_p through some
  712.           wrapper layer.
  713.  
  714.      ggggeeeettttNNNNuuuummmmIIIImmmmggggssss(((())))
  715.  
  716.           virtual int getNumImgs()
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  731.  
  732.  
  733.  
  734.           This virtual member function returns the number of images contained
  735.           in the image file.
  736.  
  737.      ggggeeeettttOOOOrrrrddddeeeerrrr(((())))
  738.  
  739.           iflOrder getOrder()
  740.  
  741.  
  742.           Returns the dimension order of the current image in the image file.
  743.  
  744.      ggggeeeettttOOOOrrrriiiieeeennnnttttaaaattttiiiioooonnnn(((())))
  745.  
  746.           iflOrientation getOrientation()
  747.  
  748.  
  749.           Returns the orientation of the current image in the image file.
  750.  
  751.      ggggeeeettttPPPPaaaaggggeeee(((())))
  752.  
  753.           virtual iflStatus getPage(void* data, int x, int y, int z,
  754.                                     int c, int nx, int ny, int nz,
  755.                                     int nc)
  756.  
  757.  
  758.           This virtual member function reads a page of image data from the
  759.           image file.
  760.  
  761.           The _d_a_t_a argument specifies the address of the memory buffer into
  762.           which the data should be placed.
  763.  
  764.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  765.           desired page within the source image file.  The caller must
  766.           guarantee that _n_x,_n_y,_n_z and _n_c are the image's page size and that
  767.           _x,_y,_z and _c are a multiple of the page size; no checking is done by
  768.           the function.
  769.  
  770.           A successful call to ggggeeeettttPPPPaaaaggggeeee() returns iflOKAY.  If an error occurs,
  771.           an iflStatus value is returned describing the error; in this case
  772.           the buffer's contents are undefined.
  773.  
  774.           If the caller is going to make multiple concurrent calls to
  775.           ggggeeeettttPPPPaaaaggggeeee() and/or sssseeeettttPPPPaaaaggggeeee(), it needs to set I/O callbacks (see the
  776.           description of sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(), sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB() for how to do
  777.           this).
  778.  
  779.           This function is required to surround code that must be executed
  780.           atomically by calls to bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO() and eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() (see the
  781.           descriptions of these functions for more details and common cases
  782.           where this is necessary).
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  797.  
  798.  
  799.  
  800.      ggggeeeettttPPPPaaaaggggeeeeDDDDiiiimmmmeeeennnnssssiiiioooonnnnssss(((())))
  801.  
  802.           void getPageDimensions(iflSize& pageDims)
  803.  
  804.  
  805.           Returns the natural page dimensions of the current image in the
  806.           image file, expressed as x == width, y == height.
  807.  
  808.      ggggeeeettttPPPPaaaaggggeeeeSSSSiiiizzzzeeee(((())))
  809.  
  810.           void getPageSize(iflSize& sz, iflOrientation toOrientation)
  811.  
  812.  
  813.           Returns the natural page size of the current image in the image
  814.           file, expressed with respect to the given orientation.
  815.  
  816.      ggggeeeettttSSSSccccaaaalllleeeeMMMMiiiinnnnMMMMaaaaxxxx(((())))
  817.  
  818.           virtual iflStatus getScaleMinMax(double& min, double& max)
  819.  
  820.  
  821.           Returns the minimum and maximum value to be used for scaling during
  822.           color conversion on the current image in the image file.
  823.  
  824.           On successful completion, iflOKAY will be returned and the _m_i_n and
  825.           _m_a_x arguments will be set to the appropriate values.
  826.  
  827.           On failure, the return value is an iflStatus encoding the reason for
  828.           the failure, and the arguments are left unmolested.
  829.  
  830.      ggggeeeettttSSSSiiiizzzzeeee(((())))
  831.  
  832.           void getSize(iflSize& sz, iflOrientation toOrientation)
  833.  
  834.  
  835.           Returns the size (x,y,z,c) of the current image in the image file,
  836.           expressed with respect to the given orientation.
  837.  
  838.           Note that the Z and C dimensions (which do not depend on the
  839.           orientation) can be obtained separately by calling getZSize() and
  840.           getCSize() respectively.
  841.  
  842.      ggggeeeettttSSSSttttaaaattttMMMMiiiinnnnMMMMaaaaxxxx(((())))
  843.  
  844.           virtual iflStatus getStatMinMax(double& min, double& max)
  845.  
  846.  
  847.           Returns the statistical min/max, i.e. the range of values that occur
  848.           in the current image in the image file.
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  863.  
  864.  
  865.  
  866.           On successful completion, iflOKAY will be returned and the _m_i_n and
  867.           _m_a_x arguments will be set to the appropriate values.
  868.  
  869.           On failure, the return value is an iflStatus encoding the reason for
  870.           the failure, and the arguments are left unmolested.
  871.  
  872.      ggggeeeettttTTTTiiiilllleeee(((())))
  873.  
  874.           iflStatus getTile(int x, int y, int z, int nx, int ny,
  875.                             int nz, void *data, const iflConfig* config=NULL)
  876.  
  877.  
  878.           This member function reads an arbitrary rectangular region from the
  879.           image file into memory.  The portions of the memory buffer
  880.           corresponding to area outside the boundaries of the source file
  881.           image are left undisturbed.
  882.  
  883.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  884.           desired tile within the source image file, in the coordinate space
  885.           indicated in the _c_o_n_f_i_g parameter.
  886.  
  887.           The _d_a_t_a argument specifies the address of the memory buffer into
  888.           which the data should be placed.
  889.  
  890.           The _c_o_n_f_i_g argument describes the configuration of the memory
  891.           buffer, and its orientation also affects the interpretation of
  892.           _x,_y,_z,_n_x,_n_y and _n_z, as described above.  If defaulted, attributes of
  893.           the buffer are assumed to match those of the image.
  894.  
  895.           A successful call to ggggeeeettttTTTTiiiilllleeee() returns iflOKAY.  If an error occurs,
  896.           an iflStatus value is returned describing the error; in this case
  897.           the buffer's contents are undefined.
  898.  
  899.      ggggeeeettttZZZZssssiiiizzzzeeee(((())))
  900.  
  901.           int getZsize()
  902.  
  903.  
  904.           Returns the Z component of the size of the current image in the
  905.           image file.
  906.  
  907.      hhhhaaaavvvveeeeAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd(((())))
  908.  
  909.           int haveAttributesChanged()
  910.  
  911.  
  912.           Returns TRUE if any image attributes have changed due to a call to
  913.           sssseeeettttIIIItttteeeemmmm() since last call to this method.
  914.  
  915.      llllooooooookkkkuuuuppppNNNNaaaammmmeeee(((())))
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  929.  
  930.  
  931.  
  932.           static int lookupName(const char* name, const iflNameDesc* names) _p_r_o_t_e_c_t_e_d
  933.  
  934.  
  935.           This method can be used to lookup parameter names/values in a list
  936.           of name/id pairs. The id associated with the first match is returned
  937.           (abbreviated names are allowed as matches).  The names array is
  938.           terminated with an entry whose associated id is returned if no match
  939.           is found.
  940.  
  941.      mmmmaaaarrrrkkkkAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd(((())))
  942.  
  943.           void markAttributesChanged()  _p_r_o_t_e_c_t_e_d
  944.  
  945.  
  946.           The method is used by a sssseeeettttIIIItttteeeemmmm() implementation to indicate that
  947.           some above the above core attributes were changed as a side effect.
  948.           This flag is tested and cleared by calling hhhhaaaavvvveeeeAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd().
  949.  
  950.      ooooppppeeeennnn(((())))
  951.  
  952.           static iflFile* open(const char* filename, int mode = O_RDONLY,
  953.                                iflStatus* status=NULL)
  954.           static iflFile* open(int fd, const char* filename, int mode=O_RDONLY,
  955.                                iflFormat* format=NULL, iflStatus* status=NULL)
  956.           static iflFile* open(iflFileDesc& fileDesc, int mode = O_RDONLY,
  957.                                iflStatus* status=NULL)
  958.  
  959.  
  960.           This static class member function opens an existing image file.
  961.  
  962.           The file is specified via the _f_i_l_e_n_a_m_e and _f_d arguments.  At least
  963.           one of these two arguments must be specified; they are interpreted
  964.           as follows.
  965.  
  966.               if filename != NULL and fd == -1:
  967.                   opens the file with the given filename.
  968.               if filename == NULL and fd != -1:
  969.                   uses the existing open file descriptor.
  970.               if filename != NULL and fd != -1:
  971.                   uses the existing open file descriptor; the filename is
  972.                   stored solely for the getFileName() method and error messages.
  973.  
  974.           The file name may be followed by an optional sub-image index using
  975.           the syntax "filename:index" (see sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmaaaaggggeeee() for how to change
  976.           the sub-image index after the file is opened).
  977.  
  978.           The mode argument specifies the desired access mode; it should be
  979.           either _O__R_D_O_N_L_Y or _O__R_D_W_R.
  980.  
  981.           The _f_o_r_m_a_t argument specifies the desired file format.  The usual
  982.           usage is to use NULL in which case the file format is deduced by the
  983.           file typing rules using the file's contents ("magic number"); this
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  995.  
  996.  
  997.  
  998.           mechanism can be bypassed by specifying the format explicitly.
  999.  
  1000.           The alternate form taking a _f_i_l_e_D_e_s_c argument, encapsulates the _f_d,
  1001.           _f_i_l_e_n_a_m_e and _f_o_r_m_a_t arguments in this single argument.  See
  1002.           iflFileDesc(3) for more details.
  1003.  
  1004.           On successful completion, the function returns a pointer to a
  1005.           newly-created object of the appropriate subclass if iflFile, which
  1006.           the application should eventually destroy using its cccclllloooosssseeee() method.
  1007.  
  1008.           On failure, the function returns NULL and, if the _s_t_a_t_u_s argument is
  1009.           non-NULL, sets the pointed-to iflStatus value to the appropriate
  1010.           error value.
  1011.  
  1012.      ppppaaaarrrrsssseeeeAAAArrrrgggguuuummmmeeeennnnttttssss(((())))
  1013.  
  1014.           int parseArguments(iflParameterDesc* params, int maxParams) _p_r_o_t_e_c_t_e_d
  1015.  
  1016.  
  1017.           This method can be used to parse the format specific argument string
  1018.           using a standard <parameter-name>=<parameter-value> syntax where
  1019.           multiple parameters are separated by spaces or '%'. The
  1020.           iflParameterDesc array pointed to by _p_a_r_a_m_s with maximum size
  1021.           _m_a_x_P_a_r_a_m_s will be filled in. The returned value is the number of
  1022.           parameters found.  The llllooooooookkkkuuuuppppNNNNaaaammmmeeee() method can be used to assist in
  1023.           decoding parameter names.
  1024.  
  1025.      ppppaaaarrrrsssseeeeFFFFiiiilllleeeeNNNNaaaammmmeeee(((())))
  1026.  
  1027.           static char* parseFileName(const char* fullname, char** formatName=NULL,
  1028.                                      int* index=NULL, char** formatArgs=NULL)
  1029.  
  1030.  
  1031.           This static class member function is used to parse a file name for
  1032.           IFL. IFL file names have the following syntax:
  1033.  
  1034.           <file-name>[#<format-name>][:<image-index>][%<format-specific>]
  1035.  
  1036.  
  1037.           The return value is the actual file name and must be delete'd by the
  1038.           user.  The format name can be returned via _f_o_r_m_a_t_N_a_m_e if it is non-
  1039.           NULL; if no format name is present in the filename then NULL will be
  1040.           returned.  The sub-image index can be returned via _i_n_d_e_x if it is
  1041.           non-NULL; if no index is present in the filename then -1 will be
  1042.           returned.  The format specific argument string can be returned via
  1043.           _f_o_r_m_a_t_A_r_g_s if it is non-NULL; if no format specific arguments are
  1044.           present in the filename then NULL will be returned.  See
  1045.           ppppaaaarrrrsssseeeeAAAArrrrgggguuuummmmeeeennnnttttssss() for optional support in parsing format specific
  1046.           arguments (recommended for consistency).
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1061.  
  1062.  
  1063.  
  1064.           This function is called automatically by the open() member function.
  1065.  
  1066.      sssseeeettttBBBBeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(((())))
  1067.  
  1068.           void setBeginFileIO_CB(iflStatus(*cb)(void*), void* arg)
  1069.  
  1070.  
  1071.           Sets the callback and arg that will be called by bbbbeeeeggggiiiinnnnFFFFiiiilllleeeeIIIIOOOO()
  1072.           during calls to ggggeeeettttPPPPaaaaggggeeee() and sssseeeettttPPPPaaaaggggeeee().  To disable this callback,
  1073.           use NULL for the _c_b argument.
  1074.  
  1075.      sssseeeettttCCCCoooolllloooorrrrmmmmaaaapppp(((())))
  1076.  
  1077.           virtual iflStatus setColormap(const iflColormap* cmap)
  1078.  
  1079.  
  1080.           Sets the color map associated with the current image to be a copy of
  1081.           the colormap pointed to by the argument _c_m_a_p.
  1082.  
  1083.           On successful completion, the function returns iflOKAY.  On failure,
  1084.           the function returns an iflStatus indicating the reason for failure.
  1085.  
  1086.           Whether or not the function succeeds, the value returned from
  1087.           previous calls to getColormap() becomes invalid.
  1088.  
  1089.      sssseeeettttCCCCoooommmmpppprrrreeeesssssssseeeeddddPPPPaaaaggggeeee(((())))
  1090.  
  1091.           virtual iflStatus setCompressedPage(...)
  1092.  
  1093.  
  1094.           This method is part of IFL's intended future support for for per-
  1095.           page compression and decompression of image data.  It is currently
  1096.           unsupported.
  1097.  
  1098.      sssseeeettttCCCCuuuurrrrrrrreeeennnnttttIIIImmmmgggg(((())))
  1099.  
  1100.           virtual iflStatus setCurrentImg(int i)
  1101.  
  1102.  
  1103.           This virtual member function sets the current image index (i.e. the
  1104.           index into the list of images or resolutions in the image file,
  1105.           starting at 0) to _i_d_x.
  1106.  
  1107.           If the operation is successful, the value iflOKAY is returned and
  1108.           the image index is changed (which may mean the dimensions and
  1109.           attributes subsequently returned by the get...() methods may be
  1110.           changed).
  1111.  
  1112.           If the argument given is out of bounds of the images in the file,
  1113.           the value iiiiffffllllSSSSttttaaaattttuuuussssEEEEnnnnccccooooddddeeee(iflFILEFINDEXOOB) is returned and the
  1114.           image index is left unchanged.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1127.  
  1128.  
  1129.  
  1130.           If the operation fails for some other reason, an ifl error will be
  1131.           thrown via the iiiiffffllllEEEErrrrrrrroooorrrr() mechanism; if the program continues, and
  1132.           the file's image index may be the old or the new index.
  1133.  
  1134.      sssseeeettttEEEEnnnnddddFFFFiiiilllleeeeIIIIOOOO____CCCCBBBB(((())))
  1135.  
  1136.           void setEndFileIO_CB(iflStatus(*cb)(void*), void* arg)
  1137.  
  1138.  
  1139.           Sets the callback and arg that will be called by eeeennnnddddFFFFiiiilllleeeeIIIIOOOO() during
  1140.           calls to ggggeeeettttPPPPaaaaggggeeee() and sssseeeettttPPPPaaaaggggeeee().  To disable this callback, use
  1141.           NULL for the _c_b argument.
  1142.  
  1143.      sssseeeettttIIIICCCCCCCCPPPPrrrrooooffffiiiilllleeee(((())))
  1144.  
  1145.           virtual iflStatus setICCProfile(int size, const void* profile)
  1146.  
  1147.  
  1148.           This virtual member function sets the value of the ICC profile
  1149.           associated with the image.  The return value is iflOKAY on success,
  1150.           or an appropriate iflStatus error value on failure.
  1151.  
  1152.      sssseeeettttIIIItttteeeemmmm(((())))
  1153.  
  1154.           iflStatus setItem(int tag, ...)
  1155.           virtual iflStatus setItem(int tag, va_list ap)
  1156.  
  1157.  
  1158.           Sets the value of an item associated with the current image in the
  1159.           image file.
  1160.  
  1161.           Calling sssseeeettttIIIItttteeeemmmm() may change some image attributes.  This can be
  1162.           check by calling hhhhaaaavvvveeeeAAAAttttttttrrrriiiibbbbuuuutttteeeessssCCCChhhhaaaannnnggggeeeedddd() after calling sssseeeettttIIIItttteeeemmmm().
  1163.  
  1164.           The _t_a_g argument specifies the name of the item to be set; it is
  1165.           interpreted by the specific iflFile subclass.  The number and types
  1166.           of the remaining arguments are determined the particular subclass of
  1167.           iflFile and the tag value.
  1168.  
  1169.           The return value is iflOKAY on success, or an appropriate iflStatus
  1170.           error value on failure.
  1171.  
  1172.           The second overloaded form of this method is used by libraries that
  1173.           are passing along a variable calling sequence in _a_p through some
  1174.           wrapper layer.
  1175.  
  1176.      sssseeeettttPPPPaaaaggggeeee(((())))
  1177.  
  1178.           virtual iflStatus setPage(const void* data, int x, int y,
  1179.                                     int z, int c, int nx, int ny,
  1180.                                     int nz, int nc)
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                                                                        PPPPaaaaggggeeee 11118888
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1193.  
  1194.  
  1195.  
  1196.           This virtual member function writes a page of image data from the
  1197.           image file.
  1198.  
  1199.           The _d_a_t_a argument specifies the address of the memory buffer
  1200.           containing the data to be written.
  1201.  
  1202.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  1203.           desired page within the source image file.  The caller must
  1204.           guarantee that _n_x,_n_y,_n_z and _n_c are the image's page size and that
  1205.           _x,_y,_z and _c are a multiple of the page size; no checking is done by
  1206.           the function.
  1207.  
  1208.           A successful call to sssseeeettttPPPPaaaaggggeeee() returns iflOKAY.  If an error occurs,
  1209.           an iflStatus value is returned describing the error; in this case
  1210.           the contents of the file are undefined.
  1211.  
  1212.           The same MP safety issues apply here as for ggggeeeettttPPPPaaaaggggeeee() (see above).
  1213.  
  1214.      sssseeeettttSSSSccccaaaalllleeeeMMMMiiiinnnnMMMMaaaaxxxx(((())))
  1215.  
  1216.           virtual iflStatus setScaleMinMax(double min, double max)
  1217.  
  1218.  
  1219.           Sets the minimum and maximum value to be used for scaling during
  1220.           color conversion on the current image in the image file.
  1221.  
  1222.           On successful completion, the function returns iflOKAY.  On failure,
  1223.           the function returns an iflStatus indicating the reason for failure.
  1224.  
  1225.      sssseeeettttSSSSttttaaaattttMMMMiiiinnnnMMMMaaaaxxxx(((())))
  1226.  
  1227.           virtual iflStatus setStatMinMax(double min, double max)
  1228.  
  1229.  
  1230.           Sets the file's notion of the range of values that occur in the
  1231.           current image in the image file.
  1232.  
  1233.           On successful completion, the function returns iflOKAY.  On failure,
  1234.           the function returns an iflStatus indicating the reason for failure.
  1235.  
  1236.      sssseeeettttTTTTiiiilllleeee(((())))
  1237.  
  1238.           iflStatus setTile(int x, int y, int z, int nx, int ny,
  1239.                             int nz, const void *data, const iflConfig* config=NULL)
  1240.  
  1241.  
  1242.           This member function writes an arbitrary rectangular region from a
  1243.           memory buffer into the image file.  The portions of the memory
  1244.           buffer corresponding to area outside the boundaries of the source
  1245.           file image are ignored.
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                                                        PPPPaaaaggggeeee 11119999
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. iiiiffffllllFFFFiiiilllleeee((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllFFFFiiiilllleeee((((3333))))
  1259.  
  1260.  
  1261.  
  1262.           The arguments _x,_y,_z,_n_x,_n_y and _n_z specify the origin and size of the
  1263.           target tile within the destination image file, in the coordinate
  1264.           space indicated in the _c_o_n_f_i_g parameter.
  1265.  
  1266.           The _d_a_t_a argument specifies the address of the memory buffer
  1267.           containing the data to be written.
  1268.  
  1269.           The _c_o_n_f_i_g argument describes the configuration of the memory
  1270.           buffer, and its orientation also affects the interpretation of
  1271.           _x,_y,_z,_n_x,_n_y and _n_z, as described above.  If defaulted, attributes of
  1272.           the buffer are assumed to match those of the image.
  1273.  
  1274.           A successful call to sssseeeettttTTTTiiiilllleeee() returns iflOKAY.  If an error occurs,
  1275.           an iflStatus value is returned describing the error; in this case
  1276.           the contents of the file are undefined.
  1277.  
  1278.           Note that sssseeeettttTTTTiiiilllleeee() may need to make calls to the subclass's
  1279.           ggggeeeettttPPPPaaaaggggeeee() as well as setPage() in order to write a tile that is not
  1280.           aligned with the file's pages.
  1281.  
  1282. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1283.      iflFormat(3), iflSize(3), iflFileDesc(3)
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.                                                                        PPPPaaaaggggeeee 22220000
  1318.  
  1319.  
  1320.  
  1321.